#Boss英雄 无需判断  已转移 -> boss_system
# execute if entity @s[tag=BossSelectFinish] run scoreboard players set @s SystemJoin 0


#特殊：管理员 SystemAdmin -1
execute if entity @s[tag=admin,scores={SystemAdmin=-1}] run tellraw @s [{"text":"您是","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"管理员","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"已为您加入战斗","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if entity @s[tag=admin,scores={SystemAdmin=-1}] run function nw:system/system_joinmap/joinmap

#特殊：VIP DataVIP 1..
execute if entity @s[scores={SystemJoin=1,DataVIP=1..}] run tellraw @s [{"text":"您拥有","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"全英雄使用权","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"已为您加入战斗","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if entity @s[scores={SystemJoin=1,DataVIP=1..}] run function nw:system/system_joinmap/joinmap

#免费英雄 检查是否为今日免费英雄 Join 2
execute if score @s SystemJoin matches 1 if score @s SystemMenu = SystemFreeHero1 System run scoreboard players set @s SystemJoin 2
execute if score @s SystemJoin matches 1 if score @s SystemMenu = SystemFreeHero2 System run scoreboard players set @s SystemJoin 2
execute if score @s SystemJoin matches 1 if score @s SystemMenu = SystemFreeHero3 System run scoreboard players set @s SystemJoin 2
execute if entity @a[scores={SystemJoin=2}] run tellraw @s [{"text":"正在使用","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"今日免费英雄","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"已为您加入战斗","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if entity @s[scores={SystemJoin=2}] run function nw:system/system_joinmap/joinmap

#永久英雄 Join 3
execute if entity @s[scores={SystemJoin=1}] run function nw:system/system_joinmap/foreverhero
execute if entity @s[scores={SystemJoin=3}] run function nw:system/system_joinmap/joinmap

#英雄体验卡 Join 5  DataEXCard 1..
execute if entity @s[scores={SystemJoin=1,DataEXCard=1..}] run scoreboard players set @s SystemJoin 5
execute if entity @s[scores={SystemJoin=5}] run scoreboard players remove @s DataEXCard 1
execute if entity @s[scores={SystemJoin=5}] run tellraw @s [{"text":"已为您自动使用1张","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"英雄体验卡","color":"light_purple","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"（剩余","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"DataEXCard","name":"@s"},"color":"light_purple","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"张）加入战斗","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if entity @s[scores={SystemJoin=5}] run function nw:system/system_joinmap/joinmap

#花费金币 Join 8  DataGold 100..
execute if entity @s[scores={SystemJoin=1,DataGold=100..}] run scoreboard players set @s SystemJoin 8
execute if entity @s[scores={SystemJoin=8}] run scoreboard players remove @s DataGold 100
execute if entity @s[scores={SystemJoin=8}] run tellraw @s [{"text":"已为您花费","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"100金币","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"（剩余","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"DataGold","name":"@s"},"color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"）加入战斗","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if entity @s[scores={SystemJoin=8}] run function nw:system/system_joinmap/joinmap

#无法加入战斗 以上都不满足
execute if entity @s[scores={SystemJoin=1}] run tellraw @s [{"text":"金币不足","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 已为您自动加入观战","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]

#这里提示还有什么礼包未领取
execute if entity @s[scores={SystemJoin=1}] run function nw:system/system_util/gift_getgift
#最后设置玩家强制死亡
execute if entity @s[scores={SystemJoin=1}] run scoreboard players set @s SystemDeath 2